Carbon


CreateNewWindow

Header: MacWindows.h Carbon status: Supported

Creates a window from parameter data.

OSStatus CreateNewWindow (
    WindowClass windowClass, 
    WindowAttributes attributes, 
    const Rect *bounds, 
    WindowRef *outWindow
);
windowClass

A constant that categorizes the type of window to be created. The window class cannot be altered once the window has been created. See “Window Class Constants” for a description of possible values for this parameter.

attributes

Set the bits in a WindowAttributes field to specify certain features and logical attributes of the window to be created. See “Window Attribute Constants” for descriptions of possible values for this parameter.

bounds

Set the rectangle to specify the size and position of the new window’s content region, in global coordinates.

outWindow

On input, apointer to a value of type WindowPtr. On return, the window pointer points to the newly created window.

function result

A result code.

DISCUSSION

The CreateNewWindow function creates a window based on the attributes and class you specify in the attributes and windowClass parameters. CreateNewWindow sets the new window’s content region to the size and location specified by the rectangle passed in the bounds parameter, which in turn determines the dimensions of the entire window. The Window Manager creates the window invisibly and places it at the front of the window list. After calling CreateNewWindow, you should set any desired associated data—using Window Manager or Control Manager accessor functions—then call the function TransitionWindow to display the window.

VERSION NOTES

This function is available with Mac OS 8.5 and later.

AVAILABILITY

Supported in Carbon. Available in CarbonLib 1.0 and later when WindowsLib 8.5 or later is installed. Exported by CarbonLib 1.0 and later and by WindowsLib 8.5 and later.


© 2000 Apple Computer, Inc. — (Last Updated 4/14/2000)